package com.hsmpay.mobile.pojo.brokerage;

import com.hsmpay.common.pojo.BasePojo;
import com.hsmpay.common.util.DateConvertUtil;
import com.hsmpay.common.util.OrderTypeUtil;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

/**
 * 佣金订单 java bean
 * 对应 info_brokerageOrder表
 */
public class BrokerageOrder extends BasePojo {
	private static final long serialVersionUID = -7830064583676716253L;
	
	//基本属性
	private Long id;
	private Long organizationId;
	private String userName;//收款人姓名
	private String bankCard;//收款人卡号
	private String openingBank;//开户行
	private String branchesBank;//支行 
	private Integer bBankProvince;//支行省
	private Integer bBankCity;//支行市
	private Double transMoney;//交易金额
	private String branchesBankCode;//支行代码   万三需要
	private Integer clearType;//结算类型
	private Integer businessType;//结算业务类型 1:OEM佣金 2：代理商佣金
	private Integer status;//结算状态 0结算失败 1 结算成功 2 结算中 3 等待结算 4 等待父级拨款 5 交易关闭 6 等待拨款 7 暂停结算
	private String message;//错误信息
	private Date createDate;//订单创建时间 取得是 合并第一个订单的时间 
	private Long longDate;//订单长整型时间
	private Date clearStartDate;
	private Date clearEndDate;
	private Integer invoiceStatus;//是否收到发票
	private String accBankCode;//三毛接口：银行代码
	private Long roleId;//终端类型ID
	private Double revenueFee;//渠道手续费
	private Double totalTransMoney;//交易总额
	private Double totalFeeMoney;//交易总手续费
	private Integer isAssign;//是否向下分拥 0 分配失败 1 已分配 2 分配中 3 未分配
	private Double clearRate;//结算费率
	private Double ownBrokerageRate;//分拥比例
	private Double fdMaxFee;//封顶最高
	private Double fdMinFee;//封顶最低
	private Double totalBrokerage;//总佣金
	private String description;//描述 不结算  或者等待父级拨款描述
	
	//合单 
	private Double orgbMoney;//原佣金
	private String orgbIds;//合单IDs
	
	//关联属性
	private String organizationName;
	private String layer;//机构层级
	private Long orgParentId;//机构父ID
	private String roleName;//终端角色名称
	private Integer sort;
	
	private String mobile;//机构手机号
	private String phone;//机构电话
	private String legalname;//法人
	
	//条件
	private String startDate;//结算开始时间
	private String endDate;//结算结束时间
	private String otherParam;//其他查询条件
	private Double relMoney;//真实金额
	private String orgParentNames;//父机构名称
	private Double startTransMoney;
	private Double endTransMoney;
	private Long paramOrgId;//机构ID 参数
	
	//
	private String statusDesc;
	private Long orderTypeId;//1 收款 8 提现
	
	private String clearMac;
	private Long broClearType;//结算类型 1、系统结算 2、代理商结算
	private Long broClearOrg;//结算机构
	
	public String getStartDate() {
		if(StringUtils.isBlank(startDate) && null != clearStartDate){
			startDate = DateConvertUtil.dateString(clearStartDate);
		}
		return startDate;
	}
	public void setStartDate(String startDate) {
		if(StringUtils.isNotBlank(startDate)){
			clearStartDate = DateConvertUtil.stringDate(startDate);
		}
		this.startDate = startDate;
	}
	public String getEndDate() {
		if(StringUtils.isBlank(endDate) && null != clearEndDate){
			endDate = DateConvertUtil.dateString(clearEndDate);
		}
		return endDate;
	}
	public void setEndDate(String endDate) {
		if(StringUtils.isNotBlank(endDate)){
			clearEndDate = DateConvertUtil.stringDate(endDate);
		}
		this.endDate = endDate;
	}
	public String getOrganizationName() {
		return organizationName;
	}
	public void setOrganizationName(String organizationName) {
		this.organizationName = organizationName;
	}
	public Integer getInvoiceStatus() {
		return invoiceStatus;
	}
	public void setInvoiceStatus(Integer invoiceStatus) {
		this.invoiceStatus = invoiceStatus;
	}
	public Long getLongDate() {
		return longDate;
	}
	public void setLongDate(Long longDate) {
		this.longDate = longDate;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		if(null != userName) userName = userName.trim();
		this.userName = userName;
	}
	public String getBankCard() {
		return bankCard;
	}
	public void setBankCard(String bankCard) {
		if(null != bankCard) bankCard = bankCard.trim();
		this.bankCard = bankCard;
	}
	public String getOpeningBank() {
		return openingBank;
	}
	public void setOpeningBank(String openingBank) {
		this.openingBank = openingBank;
	}
	public String getBranchesBank() {
		return branchesBank;
	}
	public void setBranchesBank(String branchesBank) {
		this.branchesBank = branchesBank;
	}
	public Integer getBBankProvince() {
		return bBankProvince;
	}
	public void setBBankProvince(Integer bankProvince) {
		bBankProvince = bankProvince;
	}
	public Integer getBBankCity() {
		return bBankCity;
	}
	public void setBBankCity(Integer bankCity) {
		bBankCity = bankCity;
	}
	public String getBranchesBankCode() {
		return branchesBankCode;
	}
	public void setBranchesBankCode(String branchesBankCode) {
		this.branchesBankCode = branchesBankCode;
	}
	public Double getTransMoney() {
		return transMoney;
	}
	public void setTransMoney(Double transMoney) {
		this.transMoney = transMoney;
	}
	public Integer getClearType() {
		return clearType;
	}
	public void setClearType(Integer clearType) {
		this.clearType = clearType;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Long getOrganizationId() {
		return organizationId;
	}
	public void setOrganizationId(Long organizationId) {
		this.organizationId = organizationId;
	}
	public Integer getBusinessType() {
		return businessType;
	}
	public void setBusinessType(Integer businessType) {
		this.businessType = businessType;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Date getClearStartDate() {
		return clearStartDate;
	}
	public void setClearStartDate(Date clearStartDate) {
		this.clearStartDate = clearStartDate;
	}
	public Date getClearEndDate() {
		return clearEndDate;
	}
	public void setClearEndDate(Date clearEndDate) {
		this.clearEndDate = clearEndDate;
	}
	public String getAccBankCode() {
		return accBankCode;
	}
	public void setAccBankCode(String accBankCode) {
		this.accBankCode = accBankCode;
	}
	public Long getRoleId() {
		return roleId;
	}
	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}
	public Double getRevenueFee() {
		return revenueFee;
	}
	public void setRevenueFee(Double revenueFee) {
		this.revenueFee = revenueFee;
	}
	public Double getTotalTransMoney() {
		return totalTransMoney;
	}
	public void setTotalTransMoney(Double totalTransMoney) {
		this.totalTransMoney = totalTransMoney;
	}
	public String getLayer() {
		return layer;
	}
	public void setLayer(String layer) {
		this.layer = layer;
	}
	public Double getTotalFeeMoney() {
		return totalFeeMoney;
	}
	public void setTotalFeeMoney(Double totalFeeMoney) {
		this.totalFeeMoney = totalFeeMoney;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public Integer getIsAssign() {
		return isAssign;
	}
	public void setIsAssign(Integer isAssign) {
		this.isAssign = isAssign;
	}
	public Long getOrgParentId() {
		return orgParentId;
	}
	public void setOrgParentId(Long orgParentId) {
		this.orgParentId = orgParentId;
	}
	public Integer getSort() {
		return sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	public String getOtherParam() {
		return otherParam;
	}
	public void setOtherParam(String otherParam) {
		this.otherParam = otherParam;
	}
	public Double getClearRate() {
		return clearRate;
	}
	public void setClearRate(Double clearRate) {
		this.clearRate = clearRate;
	}
	public Double getOwnBrokerageRate() {
		return ownBrokerageRate;
	}
	public void setOwnBrokerageRate(Double ownBrokerageRate) {
		this.ownBrokerageRate = ownBrokerageRate;
	}
	public Double getFdMaxFee() {
		return fdMaxFee;
	}
	public void setFdMaxFee(Double fdMaxFee) {
		this.fdMaxFee = fdMaxFee;
	}
	public Double getFdMinFee() {
		return fdMinFee;
	}
	public void setFdMinFee(Double fdMinFee) {
		this.fdMinFee = fdMinFee;
	}
	public Double getRelMoney() {
		return relMoney;
	}
	public void setRelMoney(Double relMoney) {
		this.relMoney = relMoney;
	}
	public String getOrgParentNames() {
		return orgParentNames;
	}
	public void setOrgParentNames(String orgParentNames) {
		this.orgParentNames = orgParentNames;
	}
	public Double getTotalBrokerage() {
		return totalBrokerage;
	}
	public void setTotalBrokerage(Double totalBrokerage) {
		this.totalBrokerage = totalBrokerage;
	}
	public Double getStartTransMoney() {
		return startTransMoney;
	}
	public void setStartTransMoney(Double startTransMoney) {
		this.startTransMoney = startTransMoney;
	}
	public Double getEndTransMoney() {
		return endTransMoney;
	}
	public void setEndTransMoney(Double endTransMoney) {
		this.endTransMoney = endTransMoney;
	}
	public Long getParamOrgId() {
		return paramOrgId;
	}
	public void setParamOrgId(Long paramOrgId) {
		this.paramOrgId = paramOrgId;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getLegalname() {
		return legalname;
	}
	public void setLegalname(String legalname) {
		this.legalname = legalname;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Double getOrgbMoney() {
		return orgbMoney;
	}
	public void setOrgbMoney(Double orgbMoney) {
		this.orgbMoney = orgbMoney;
	}
	public String getOrgbIds() {
		return orgbIds;
	}
	public void setOrgbIds(String orgbIds) {
		this.orgbIds = orgbIds;
	}
	public String getStatusDesc() {
		if(StringUtils.isEmpty(statusDesc) && null != status)
			statusDesc = OrderTypeUtil.broStatusMap.get(status);
		return statusDesc;
	}
	public void setStatusDesc(String statusDesc) {
		this.statusDesc = statusDesc;
	}
	public Long getOrderTypeId() {
		return orderTypeId;
	}
	public void setOrderTypeId(Long orderTypeId) {
		this.orderTypeId = orderTypeId;
	}
	public String getClearMac() {
		return clearMac;
	}
	public void setClearMac(String clearMac) {
		this.clearMac = clearMac;
	}
	public Long getBroClearType() {
		return broClearType;
	}
	public void setBroClearType(Long broClearType) {
		this.broClearType = broClearType;
	}
	public Long getBroClearOrg() {
		return broClearOrg;
	}
	public void setBroClearOrg(Long broClearOrg) {
		this.broClearOrg = broClearOrg;
	}
}
